Skip to content

Test debug-inline capture of a local function from a nested closure - #20299

Merged
T-Gro merged 3 commits into
mainfrom
t-gro-fix-20297-debug-inline-captured-locals-t
Aug 24, 2026
Merged

T-Gro merged 3 commits into
mainfrom
t-gro-fix-20297-debug-inline-captured-locals-t

Conversation

@T-Gro

@T-Gro T-Gro commented Aug 19, 2026

Copy link
Copy Markdown
Member

Regression test only — #20297 is already fixed on main by #20089.

Existing coverage applies the inline function directly from the enclosing method. This test applies it inside a nested closure, so the captured local reaches the synthesized <name>__debug@N method through a closure field. Before #20089 that emitted ldarg.0; ldfld against a string parameter and crashed with AccessViolationException.

release/10.0.4xx (SDK 10.0.400) has #19548 but not #20089, and is still affected.

…callsite

Regression coverage for #20297. The reduced repro keeps the reported
shape - a captured local function, a callsite inside a nested closure,
and '>>' composition - and crashes with AccessViolationException on
release/10.0.4xx, where <addEnum>__debug@N is emitted as a two-argument
static method that does 'ldarg.0; ldfld tee' against the string
parameter. It passes once #20089 is present.

SRTP 30-38 all call the inline function directly from the enclosing
method, so none of them cover a callsite inside a closure.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Release notes required, but author opted out

Warning

Author opted out of release notes, check is disabled for this pull request.
cc @dotnet/fsharp-team-msft

@github-actions github-actions Bot added the AI-Tooling-Check-Bypassed Tooling check: non-fork PR, not diff-analyzed label Aug 19, 2026
@T-Gro T-Gro added the NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes label Aug 19, 2026
@T-Gro
T-Gro requested review from abonie and auduchinok August 19, 2026 13:45

@auduchinok auduchinok left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@T-Gro
T-Gro enabled auto-merge (squash) August 20, 2026 11:04
Copilot and others added 2 commits August 20, 2026 13:45
Address review feedback: strip printfn and addName noise from the repro so the emitted-IL baseline is easier to follow. The minimized source keeps all essential ingredients (inline function whose body is a lambda capturing an outer local 'tee', used first-class inside a nested closure via >>) and the SRTP 'int value'/ExplicitDynamic aspect, so <addEnum>__debug@N still reaches the captured local through a closure field.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-Tooling-Check-Bypassed Tooling check: non-fork PR, not diff-analyzed NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants